package com.zhida.jiyangcenter.mian

import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import chooongg.base.annotation.ContentLayout
import chooongg.base.annotation.TitleBar
import chooongg.base.utils.visible
import chooongg.base.widget.recyclerView.divider.HorizontalDividerItemDecoration
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.zhida.jiyangcenter.R
import kotlinx.android.synthetic.main.list.*

@TitleBar(false)
@ContentLayout(R.layout.list)
class CardServeActivity : BaseActivity() {
    val adapter = Adapter()

    override fun initConfig(savedInstanceState: Bundle?) {
        title_bar.visible()
        title_bar.navigationIcon(R.drawable.iv_back_fill) {
            finish()
        }.title("会员卡服务")
        recycler_view.layoutManager = LinearLayoutManager(context)
        recycler_view.addItemDecoration(
            HorizontalDividerItemDecoration.Builder(context).sizeResId(R.dimen.dividerBig)
                .colorResId(R.color.colorBack).build()
        )
        recycler_view.adapter = adapter
        adapter.setNewData(ArrayList<String>().apply {
            add("asdjkas")
            add("sadsjk")
            add("sadsjk")
            add("sadsjk")
            add("sadsjk")
            add("sadsjk")
            add("sadsjk")
        })
    }

    class Adapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_serve_card) {
        override fun convert(helper: BaseViewHolder, item: String?) {
            helper.setText(R.id.tv_item_buy_car_name, "服务项目${helper.layoutPosition + 1}")
        }

    }
}